<?php
	include("../../tools/mysql.php");
	db_connect();
	
	$username = $_GET["username"];
	$username = (! $username) ? "blank name" : $username;
	$sql = "SELECT count(username) num FROM user WHERE username='" . $username . "'";
	$sql2 = "SELECT count(username) num FROM archive WHERE username='" . $username . "'";
	$re = db_query_once($sql);
	$re2 = db_query_once($sql2);
	
	if ($re["num"] == 0 && $re2["num"] == 0) {
		echo "Success: no name!";
	} else {
		echo "Error: name " . $username . " has been used!";
	}
?>
